home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / hardware / gm1507 / tutor01.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1994-10-26  |  1.6 KB  |  70 lines

  1. {************************************************}
  2. {                                                }
  3. {   Turbo Vision 2.0 Demo                        }
  4. {   Copyright (c) 1992 by Borland International  }
  5. {                                                }
  6. {************************************************}
  7. { Modified by Bobby Z. to demonstrate usage of
  8.   g_Mouse Interface unit Version 1.50.7. This code
  9.   assumes that you changed Views.WriteView logic
  10.   in part determining mouse pointer presence in
  11.   rectangle to be redrawn. }
  12.  
  13. program Tutor01;
  14.  
  15. uses App, 
  16.      Objects, 
  17.      Drivers, 
  18.      Memory, 
  19.      Views,
  20.      Menus,
  21.      Dos,
  22.      g_Mouse;
  23.  
  24. type
  25.   TTutorApp = object(TApplication)
  26.            procedure DOSShell; virtual;
  27.            procedure InitMenuBar; virtual;    
  28.               end;
  29.  
  30. procedure TTutorApp.DOSShell;
  31.  begin
  32.   DoneSysError;
  33.   DoneEvents;
  34.   DoneGMouse;    { !!! }
  35.   DoneVideo;
  36.   DoneDosMem;
  37.   WriteShellMsg;
  38.   SwapVectors;
  39.   Exec(GetEnv('COMSPEC'), '');
  40.   SwapVectors;
  41.   InitDosMem;
  42.   InitVideo;
  43.   InitGMouse(True); { !!! }
  44.   InitEvents;
  45.   InitSysError;
  46.   Redraw;
  47. end;
  48.  
  49. procedure TTutorApp.InitMenuBar;
  50.  var R : TRect;
  51.  begin
  52.   GetExtent(R);
  53.   R.B.Y := R.A.Y+1;
  54.   MenuBar := New(PMenuBar, Init(R,NewMenu(
  55.           NewSubMenu('~F~ile',hcNoContext,NewMenu(
  56.                NewItem('DOS ~S~hell','',kbNoKey,cmDosShell,hcNoContext,
  57.            NewItem('E~x~it','Alt-X',kbAltX,cmQuit,hcNoContext,
  58.                nil))),
  59.               nil))));
  60.  end;
  61.  
  62. var 
  63.     TutorApp : TTutorApp;
  64.  
  65. begin
  66.   TutorApp.Init;
  67.   TutorApp.Run;
  68.   TutorApp.Done;
  69. end.
  70.